package com.cloud.xtools.user.service.admin;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloud.xtools.common.response.PageList;
import com.cloud.xtools.user.domain.entity.Permission;
import com.cloud.xtools.user.domain.query.admin.PermissionQuery;
import com.cloud.xtools.user.domain.request.admin.PermissionCreateRequest;
import com.cloud.xtools.user.domain.request.admin.PermissionUpdateRequest;
import com.cloud.xtools.user.domain.resource.admin.PermissionResource;
import com.cloud.xtools.user.domain.resource.admin.PermissionTreeResource;

import java.util.List;

/**
 * @author Daixinguo
 */
public interface PermissionService extends IService<Permission> {
    Long countByIds(List<Long> permissionIds);

    PageList list(PermissionQuery permissionQuery);

    List<PermissionTreeResource> treeList();

    // 添加
    PermissionResource add(PermissionCreateRequest permissionCreateRequest);

    // 编辑
    void edit(Long id, PermissionUpdateRequest permissionUpdateRequest);

    // 删除
    void destroy(Long id);

    // 根据 id 获取 identity
    List<String> getIdentityByIds(List<Long> permissionIds);
}
